package com.eastmoney.tutorial.android.myapp;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;

/**
 * Created by benny.xu on 2016-03-27.
 */
public class LoginActivity extends Activity
        implements View.OnClickListener {


    private Button btnLogin ;

    private EditText edtUser;
    private EditText edtPass;


    private WebView wev1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);

        edtUser = (EditText) findViewById(R.id.edtUser);
        edtPass =(EditText) findViewById(R.id.editText4);


        btnLogin = (Button) findViewById(R.id.btnLogin);
        btnLogin.setOnClickListener(this);



    }

    @Override
    public void onClick(View view) {
        if (view.getId()==btnLogin.getId()){

            Intent result= new Intent();
            result.putExtra("result", "u="+ edtUser.getText() + "p="+ edtPass.getText() );
            setResult(2,result);
            finish();







                /*  Dialog alertDialog = new AlertDialog.Builder(LoginActivity.this).
                    setTitle("登陆").
                    setMessage("正在登陆通行证").
                    setIcon(R.drawable.ic_launcher).
                    create();
                    alertDialog.show();*/


        }
    }
}